package com.ls.kdlss.ui.Login;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.gm.common.utils.ActivityUtil;
import com.gm.lib.views.titlebar.AbTitleBar;
import com.ls.kdlss.R;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by Administrator on 2016/10/26.
 */

public class VerjfjcatjnActivity extends AppCompatActivity implements View.OnClickListener {


    @Bind(R.id.title_bar)
    AbTitleBar titleBar;
    @Bind(R.id.textView)
    TextView textView;
    @Bind(R.id.ed_1)
    EditText ed1;
    @Bind(R.id.ed_2)
    EditText ed2;
    @Bind(R.id.ed_3)
    EditText ed3;
    @Bind(R.id.ed_4)
    EditText ed4;

    public static void launch(Context context,String type) {
        ActivityUtil.startActivity(context, VerjfjcatjnActivity.class);
    }


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_verification);
        ButterKnife.bind(this);
        guangbiao();
        titleBar.setLeftVisible();
        titleBar.setTitleText("验证码");
    }

    public void guangbiao(){

        TextWatcher textWatcher=new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {



            }

            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {

            }

            @Override
            public void afterTextChanged(Editable s) {


                if (ed1.getText().length()!=0){
                    ed2.requestFocus();
                }
                if (ed2.getText().length()!=0){
                    ed3.requestFocus();
                }
                if (ed3.getText().length()!=0){
                    ed4.requestFocus();
                }


            }
        };

        ed1.addTextChangedListener(textWatcher);
        ed2.addTextChangedListener(textWatcher);
        ed3.addTextChangedListener(textWatcher);


    }


    @Override
    public void onClick(View v) {



    }


}
